package com.dididoctor.doctor.Activity.Main.Inquiry;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.dididoctor.doctor.Activity.Main.Inquiry.InquiryDetail.InquiryDetailActivity;
import com.dididoctor.doctor.MV.adapter.CommonAdapter;
import com.dididoctor.doctor.MV.adapter.ViewHolder;
import com.dididoctor.doctor.R;
import com.dididoctor.patient.Bean.DiaeasesLitapal;

import java.util.List;

/**
 * @version 2.0
 * @类描述：
 * @项目名称：ddgh
 * @类名称： InquityListAdapter
 * @包名称： com.dididoctor.doctor.Activity.Main.Inquiry.InquiryDetail
 * @创建人： zhanjunjie
 * @创建时间：2016/4/20 11:15
 * @修改人：
 * @修改时间：2016/4/20 11:15
 * @修改备注： new parent class(用一句话描述修改了什么)
 */
public class InquityListAdapter extends CommonAdapter<DiaeasesLitapal> {

    private TextView mTvdisname;
    private Context context;

    public InquityListAdapter(Context context, List<DiaeasesLitapal> datas) {
        super(context, datas, R.layout.item_inquiry_list);
        this.context = context;
    }


    @Override
    public void convert(int position, ViewHolder helper, final DiaeasesLitapal item) {
        mTvdisname = helper.getView(R.id.tv_diseasesname);
        mTvdisname.setText(item.getName() + "问诊表");
        helper.getView(R.id.ll_dis).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(context, InquiryDetailActivity.class);
                intent.putExtra("diseId", item.getDisId());
                intent.putExtra("titlename", item.getName() + "问诊表");
                context.startActivity(intent);
            }
        });
    }
}
